import java.awt.Color;
import java.awt.Image;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;

/**
 * @author MegaTool
 *
 */
public class Sprite {
	
	public final static int FACE_NORTH = 0;
	public final static int FACE_SOUTH = 1;
	public final static int FACE_EAST = 2;
	public final static int FACE_WEST = 3;
	//TODO: 
	public final static int DEFAULT_PIXEL_BASE = 16;
	
	int pixelBase;
	
	int currentFace;
	
	int col;
	int row;
	
	public Sprite()	{
		currentFace = FACE_SOUTH;
		
		col = 0;
		row = 0;
		
		pixelBase = DEFAULT_PIXEL_BASE;
	}
	
	
	public Color getColor()	{
		Color color = Color.BLACK;
		switch(this.currentFace){
		case FACE_NORTH:
			color = Color.BLUE;
			break;
		case FACE_SOUTH:
			color = Color.RED;
			break;
		case FACE_EAST:
			color = Color.GREEN;
			break;
		case FACE_WEST:
			color = Color.ORANGE;
			break;
		}
		
		return color;
	}//end getColor;
	
	public int getCol() {
		return col;
	}
	public void setCol(int col) {
		this.col = col;
	}
	public int getRow() {
		return row;
	}
	public void setRow(int row) {
		this.row = row;
	}
	
	public int getCurrentFace() {
		return currentFace;
	}


	public void setCurrentFace(int currentFace) {
		this.currentFace = currentFace;
	}


	public int getPixelBase() {
		return pixelBase;
	}


	public void setPixelBase(int pixelBase) {
		this.pixelBase = pixelBase;
	}


	public Image getAvatarImage() {
		Image img = null;
		try {
		    img = ImageIO.read(new File("Avatar1.png"));
		} catch (IOException e) {
			System.err.println("Sprite.getAvatarImage(): Did not retrieve Avatar image");
		}
		return img;
	}
	
	

}
